package field_method5;

public class FruitTest {
    public static void main(String[] args) {
        Fruit apple = new Apple();
        apple.setName("苹果");
        apple.setArea("云南");
        apple.setPrice(5);
        apple.setType("红苹果");

        Fruit banana = new Banana();
        banana.setName("香蕉");
        banana.setArea("广东");
        banana.setPrice(6);
        banana.setType("芭蕉");

        Cherry cherry = new Cherry();
        cherry.setName("樱桃");
        cherry.setArea("广西");
        cherry.setPrice(10);
        cherry.setType("车厘子");

        System.out.println("水果名：" + apple.getName() + "，出产地：" + apple.getArea() + "，品种：" + apple.getType() + "，价格：" + apple.getPrice() + "元/斤");
        System.out.println("水果名：" + banana.getName() + "，出产地：" + banana.getArea() + "，品种：" + banana.getType() + "，价格：" + banana.getPrice() + "元/斤");
        System.out.println("水果名：" + cherry.getName() + "，出产地：" + cherry.getArea() + "，品种：" + cherry.getType() + "，价格：" + cherry.getPrice() + "元/斤");
    }

}
